<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% 
String path=request.getContextPath(); 
String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="<%=basePath%>">
<title>组合险列表</title>

<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
<style type="text/css">
		#detail
        {
            position:relative; 
            font-size: 12px;
            background: #fff;
            border: 1px solid #000;
            z-index: 2;
            display: none;
        } 
        #detail2
        {
            position:relative;
            font-size: 12px;
            background: #fff;
            border: 1px solid #000;
            z-index: 2;
            display: none;
        } 
	</style>
</head>

<script type="text/javascript">
	//自定义map功能
	function Map(){
	  this.elements = new Array();
	   //获取MAP元素个数
	   this.size = function() {
	       return this.elements.length;
	   };
	   //判断MAP是否为空
	   this.isEmpty = function() {
	       return (this.elements.length < 1);
	   };
	   //删除MAP所有元素
	   this.clear = function() {
	       this.elements = new Array();
	   };
	   //向MAP中增加元素（key, value)
	   this.put = function(_key, _value) {
	       if(this.containsKey(_key)){
	        this.remove(_key);
	        this.elements.push( {
	           key : _key,
	           value : _value
	        });
	       }else{
	        this.elements.push( {
	           key : _key,
	           value : _value
	        });
	       }  
	   };
	   //删除指定KEY的元素，成功返回True，失败返回False
	   this.remove = function(_key) {
	       var bln = false;
	       try {
	           for (var i = 0; i < this.elements.length; i++) {
	               if (this.elements[i].key == _key) {
	                   this.elements.splice(i, 1);
	                   return true;
	               }
	           }
	       } catch (e) {
	           bln = false;
	       }
	       return bln;
	   };
	   //获取指定KEY的元素值VALUE，失败返回NULL
	   this.get = function(_key) {
	       try {
	           for (var i = 0; i < this.elements.length; i++) {
	               if (this.elements[i].key == _key) {
	                   return this.elements[i].value;
	               }
	           }
	       } catch (e) {
	           return false;
	       }
	       return false;
	   };
	   //判断MAP中是否含有指定KEY的元素
	   this.containsKey = function(_key) {
	       var bln = false;
	       try {
	           for (var i = 0; i < this.elements.length; i++) {
	               if (this.elements[i].key == _key) {
	                   bln = true;
	               }
	           }
	       } catch (e) {
	           bln = false;
	       }
	       return bln;
	   };
	  //获取map的所有values
	  this.values = function() {
	       var arr = new Array();
	       for (var i = 0; i < this.elements.length; i++) {
	           arr.push(this.elements[i].value);
	       }
	       return arr;
	   };
	  //获取map的所有keys
	  this.keys= function() {
	       var arr = new Array();
	       for (var i = 0; i < this.elements.length; i++) {
	           arr.push(this.elements[i].key);
	       }
	       return arr;
	   };
	   //获取数组
	   this.getArray= function(){
	   	var arr = new Array();
	   	for (var i = 0; i < this.elements.length; i++) {
	           arr.push({
		            key : this.elements[i].key,
		            value : this.elements[i].value
		         });
	       }
	       return arr;
	   };
	}
//********************************************	

	var map=new Map();
	var maxPlan=10;
	$(document).ready(function() {
		queryGrouList(1);
	});
	function addGroup(){
		$('#editflag').val('add');
		$('#groupCode').val('');
		$('#groupName').val('');
		$('#partnerNo').val('');
		$('#smsTemplet').val('');
		$('#mailTemplet').val('');
		$('#groupDesc').val('');
		$('#addtempletDiv').OpenDiv();
		$('#openChannelPageDivBtn').attr("disabled",false);
	}
	function closetempletDiv(){
		$('#addtempletDiv').CloseDiv();
	}
	//拼接页面查询参数  查询投保单位
	function openChannelPageDiv(pageIndex){
		var size = 8;
		var channelCode = $('#channelCode').val();
		var channelName = $('#channelName').val();
		queryPartner({pageIndex:pageIndex,size:size,channelCode:channelCode,channelName:channelName});
	}
	//initTradPartners
	function queryPartner(param){
		$("#BigDiv2").remove();
		$.openLoading();
		$.ajax({
			url : "planGroupConfig/loadChannelInfo",
			type : 'POST',
			async : true,
			data:param,
			dataType:'json',
			success:function(partnerPage){
				$.closeLoading();
				if($.validate(partnerPage))return;
					var radioObj ="<input class='input_fxk' name='partnerradio' type='radio' value=''>";
					var fieldNames = "channelCode@TDH,channelCode,channelName,transType@TDH";
					var tableContent = creatTable1(fieldNames,partnerPage,radioObj);
					var tableObj = $("#TradPartnerTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);
					
				 	var strPage = creatChannelPage2(param.pageIndex,6,partnerPage.maxPage,"66");
					var pageDIV = $("#TradPartnerPageDIV"); 
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage); 
					$('#tradPartnerDiv').OpenDiv2();
					bindradio();
				}
		});
	}
	//关闭  窗口
	function closeCurrentDIV(obj){
		$("#"+obj).CloseDiv2();
	}
	//合作伙伴选择
	//绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
	function bindradio(){
		$("input[name='partnerradio']").click(function(){
			$("input[name='partnerradio']").parent().parent().removeClass("table_highlighter");
			$(this).parent().parent().addClass("table_highlighter");
	   	});
		$("input[name='checkPlan']").click(function(){
			var id= $(this).parent().parent().children(" td:eq(1)").html();
			var seeMoney= $(this).parent().parent().children(" td:eq(5)").html();
			var requered= $(this).parent().parent().children(" td:eq(6)").find('select').val();
			if($(this).prop("checked")){//选中
				//方案选中验证
				if(!map.isEmpty()){
					var keys=map.keys();
					//方案数量不能超过最大数
					if((keys.length+1)>maxPlan){
						$.message("error", "方案数量不能超过"+maxPlan);
						$(this).prop("checked",false);
						return;
					}else{
						for(i in map.keys()){
					        var key = map.keys()[i];
					        var obj=map.get(key);
					        if(seeMoney=='YD'){
					        	seeMoney='Y'
					        }
					        if(seeMoney!=obj.seeMoney){
					        	$.message("error", "见费与非见费方案不能同时选择");
								$(this).prop("checked",false);
								return;
					        }
					    }
					}
				}
				$(this).parent().parent().addClass("table_highlighter");
				var obj = new Object();
				obj.id =id;
				obj.seeMoney=seeMoney;
				obj.requered=requered;
				map.put(obj.id,obj);
			}else{//取消选中
				$(this).parent().parent().removeClass("table_highlighter");
				$(this).prop("checked",false);
				map.remove(id);
			}
		});
	}
	//点击“确定”按钮，选择投保单位
	function choosePartner(){
		var selectedPartner = $("input[name='partnerradio']:checked");
		if(selectedPartner.length==0){
			$.message("error", "请选择一个合作伙伴");
			return;
		}
		var pno = selectedPartner.parent().parent().children(" td:eq(2)").html();
		$('#partnerNo').val(pno);
		closeCurrentDIV('tradPartnerDiv');
	}
	 function copyDetail(obj){
		var result=obj.innerHTML;
		var i=$(obj).parent().prevAll().length;
		if(i==5){
			result=$(obj).parent().parent().children(" td:eq(9)").html()
		}
		if(result!=""){
			 var length =obj.scrollWidth;
			 if(length>0){
			 	var e = arguments.callee.caller.arguments[0]||window.event;
			 	var y = e.clientY;
			 	var x= document.body.offsetWidth;
			 	if(x>460){
			 		x=x-460;
			 	}
			 	var div3 = document.getElementById("detail2");   
       	 		document.getElementById("detail2").style.display = 'block';
       	 		//div显示位置
			 	if(i!=5){
	       	 		div3.style.left=x-80;     
			 	}else{
	       	 		div3.style.left=x;     
			 	}
	            div3.style.top=e.clientY+1;  
	            div3.style.position="absolute";
			 	$("#output")[0].innerHTML=result;
			 }
		}
	}
	 function showDatail(obj){
			var result=obj.innerHTML;
			var i=$(obj).parent().prevAll().length;
			if(i==5){
				result=$(obj).parent().parent().children(" td:eq(9)").html()
			}
			if(result!=""){
				 var length =obj.scrollWidth;
				 if(length>240){
				 	var e = arguments.callee.caller.arguments[0]||window.event;
				 	var y = e.clientY;
				 	var x= document.body.offsetWidth;
				 	if(x>460){
				 		x=x-460;
				 	}
				 	var div3 = document.getElementById("detail");   
				 	document.getElementById("detail").style.display = 'block';
				 	//div显示位置
				 	if(i!=5){
				 		div3.style.left=x-80;     
				 	}else{
				 		div3.style.left=x;	
				 	}
		            div3.style.top=e.clientY+1;  
		            div3.style.position="absolute";
				 	$("#input")[0].innerHTML=result;
				 }
			}
		}
	 function closeDatail(){
		 document.getElementById("detail").style.display = 'none';
	 }
	 function closeDiv(){
		 document.getElementById("detail2").style.display = 'none';
 	 }
	//查询组合方案
	function queryGroup(param){
		$.openLoading();
		$.ajax({
			url : "planGroupConfig/queryGroupPageByCriteria",
			type : 'POST',
			async : true,
			data:param,
			dataType:'json',
			success:function(page){
			    $.closeLoading();
				startP = page.current;
				var firstbutton='';
				var data = page.data;
				if(data){
					for(var i=0;i<data.length;i++){
						var SEEFEE_SPECIAL_FLAG = data[i].SEEFEE_SPECIAL_FLAG;
						data[i].SEEFEE_SPECIAL_FLAG = SEEFEE_SPECIAL_FLAG?(SEEFEE_SPECIAL_FLAG=='Y'?'是':'否'):'';
					}
				}
				var sms="<a href='javascript:void(this)' style='font-size:12px;display: block;overflow: hidden;white-space: nowrap;text-align:center;-o-text-overflow: ellipsis;text-overflow: ellipsis;width:120px;font-family:宋体;font-weight:normal' onDblClick='copyDetail(this);' onclick='showDatail(this);return false' onmouseover='showDatail(this);return false' onmouseout='closeDatail(this);return false'>SMS_TEMPLATE_CODE</a>";
				var mail="<a href='javascript:void(this)' style='font-size:12px;display: block;overflow: hidden;white-space: nowrap;text-align:center;-o-text-overflow: ellipsis;text-overflow: ellipsis;width:120px;font-family:宋体;font-weight:normal' onDblClick='copyDetail(this);' onclick='showDatail(this);return false' onmouseover='showDatail(this);return false' onmouseout='closeDatail(this);return false'>MAIL_SHOW</a>";
				firstbutton ="<input class='input_fxk' name='checkPlan1' type='checkBox' value='#'>";
				var lastbutton = "<a href='javascript:void(0)' onClick='editTradGroup(this);return false'>编辑</a>&nbsp;<a href='javascript:void(0)' onClick='delTradGroup(this);return false'>删除</a>&nbsp;<a href='javascript:void(0)' onClick='addGroupPlan(this);return false'>方案管理</a>";
				var tableContent = creatTable1("GROUP_CODE,GROUP_NAME,CHANNEL_NAME,PARTNER_CODE@TDH,SEEFEE_SPECIAL_FLAG,"+sms+","+mail+",GROUP_DESC,GROUP_ID@TDH,MAIL_TEMPLATE@TDH,GROUP_EURL@TDH,IS_CORE_MESSAGE@TDH,MESSAGE_RECEIVER@TDH",page,firstbutton,lastbutton);
				var tableObj = $("#groupPlanTable");
				tableObj.find("tbody").remove();
				tableObj.append(tableContent);
				var strPage = creatChannelPage2(startP,6,page.maxPage,"67");
				var pageDIV = $("#groupPlanPageDIV");
				pageDIV[0].innerHTML="";
				pageDIV.append(strPage);
			}
		});
	}
	//组合方案编辑
	function editTradGroup(obj){
		var editTr = $(obj).parent('td').parent('tr')[0];	
		var groupCode = editTr.childNodes[1].innerHTML;
		var groupName = editTr.childNodes[2].innerHTML;
		var partnerCode = editTr.childNodes[4].innerHTML;
		var seefeeSpecialFlag = editTr.childNodes[5].innerHTML;
		seefeeSpecialFlag = seefeeSpecialFlag?(seefeeSpecialFlag=='是'?'Y':'N'):'';
		var smsTempletCode=$(obj).parent().parent().children("td:eq(6)").find('a').html();
		var mailTemplet=$(obj).parent().parent().children("td:eq(10)").html();;
		var groupDesc=editTr.childNodes[8].innerHTML;
		var id=editTr.childNodes[9].innerHTML;
		var groupEURL = editTr.childNodes[11].innerHTML;
		var isCoreMessage = editTr.childNodes[12].innerHTML;
		if('Y'==isCoreMessage){
			isCoreMessage=='是';
			$('#messageReceiverDiv').show();
		}else if('N'==isCoreMessage){
			isCoreMessage=='否';
		}else{
			isCoreMessage=='';
		}
		var messageReceiver = editTr.childNodes[13].innerHTML;
		if('0'==messageReceiver){
			messageReceiver=='投保人';
		}else if('1'==messageReceiver){
			messageReceiver=='被被人';
		}else{
			messageReceiver=='';
		}
		$('#openChannelPageDivBtn').attr("disabled",true);
		$('#editflag').val('edit');
		$('#groupCode').val(groupCode);
		$('#editId').val(id);
		$('#groupName').val(groupName);
		$('#partnerNo').val(partnerCode);
		$('#smsTemplet').val(smsTempletCode);
		$('#mailTemplet').val(mailTemplet);
		$('#groupDesc').val(groupDesc);
		$('#seefeeSpecialFlag').val(seefeeSpecialFlag);
		$('#groupEURL').val(groupEURL);
		$('#addtempletDiv').OpenDiv();
		$('#isMessage').val(isCoreMessage);	
		$('#messageReceiver').val(messageReceiver);
	}
	//拼接页面查询参数  查询投保单位
	function queryGrouList(pageIndex){
		var groupCode=$('#groupCodeSe').val();
		var groupName=$('#groupNameSe').val();
		var size = 8;
		queryGroup({current:pageIndex,size:size,groupCode:groupCode,groupName:groupName});
	}
	//组合方案保存
	function saveGroup (){
		var groupCode=$('#groupCode').val();
		if(groupCode==''){
			$.message("error", "请输入组合方案代码");
			return;
		}
		var flag=$('#editflag').val();
		var groupId='';
		if(flag=='edit'){
			groupId=$('#editId').val();
		}
		var groupName=$('#groupName').val();
		if(groupName==''){
			$.message("error", "请输入组合方案名称");
			return;
		}
		var partnerCode=$('#partnerNo').val();
		if(partnerCode==''){
			$.message("error", "请选择合作伙伴");
			return;
		}
		var seefeeSpecialFlag = $('#seefeeSpecialFlag').val();
		var groupEURL = $('#groupEURL').val();
		var smsTempletCode=encodeURI($('#smsTemplet').val());
		var mailTemplet=encodeURI($('#mailTemplet').val());
		var groupDesc=$('#groupDesc').val();
		var isMessage=$('#isMessage').val();
		var messageReceiver=$('#messageReceiver').val();
		if('Y'==isMessage && !messageReceiver){
			$.message("error", "请选择短信接收人");
			return;
		}
		$.openLoading();
		$.ajax({
			url : "planGroupConfig/saveGroup",
			type : 'POST',
			async : true,
			data:{groupCode:groupCode,groupName:groupName,partnerCode:partnerCode,smsTempletCode:smsTempletCode,mailTemplet:mailTemplet,groupDesc:groupDesc,flag:flag,groupId:groupId,seefeeSpecialFlag:seefeeSpecialFlag,groupEURL:groupEURL,isCoreMessage:isMessage,messageReceiver:messageReceiver},
			dataType:'json',
			success:function(result){
				$.closeLoading();
				$.message(result.result, result.message);
				if(result.result=='success'){
					closetempletDiv();
					queryGrouList();
				}
			}
		});
	}
	//拼接参数查询方案关联列表
	function queryGrouPlanList(pageIndex){
		var planCode=$('#planCode').val();
		var planName=$('#planName').val();
		var isSeeMoney=$('#isSeeMoney').val();
		var partnerCode=$('#planPartner').val();
		var id=$('#editId').val();
		var size = 10;
		queryGroupPlan({current:pageIndex,size:size,planCode:planCode,planName:planName,isSeeMoney:isSeeMoney,id:id,partnerCode:partnerCode});
	}
	//是否必须修改事件
	function requeredChange(obj){
		var planNo= $(obj).parent().parent().children(" td:eq(2)").html();
		if(map.get(planNo)){
			var obj1=map.get(planNo);
			obj1.requered=$(obj).val();
			map.put(planNo,obj1);
		}
	}
	//方案组方案关联查询
	function queryGroupPlan(param){
		$.openLoading();
		$("#BigDiv2").remove();
		$.ajax({
			url : "planGroupConfig/queryPlanPageByCriteria",
			type : 'POST',
			async : true,
			data:param,
			dataType:'json',
			success:function(page){
			    $.closeLoading();
			    var data=page.data;
				if(data!=undefined){	
					$.each(data,function(i,item){
						if(item.PLAN_GROUP_ID!=null){
							var obj = new Object();
				        	obj.id = item.PLANCODE;
				        	obj.seeMoney=item.SEEMONEY;
				        	obj.requered=item.REQUIRED;
				        	map.put(obj.id,obj);
						}
					})
				}
				startP = page.current;
				var firstbutton="<input type='checkBox' value='' name='checkPlan' class='input_fxk'>";
				var lastbutton='<select style="visibility: visible;" name="requered" onchange="requeredChange(this)"><option value="0">否</option><option value="1">是</option></select>'
				var tableContent = creatTable2("PLANCODE,PLANNAME,SEEMONEY?[{Y:'是'};{N:'否'};{YD:'见费已缴费'}],PLANTYPE?[{0:'新意健险'};{1:'财险'}],SEEMONEY@TDH",page,firstbutton,lastbutton);
				var tableObj = $("#groupPlanDivTable");
				tableObj.find("tbody").remove();
				tableObj.append(tableContent);
				var strPage = creatChannelPage(startP,6,page.maxPage,"68");
				var pageDIV = $("#groupPlanDivPage");
				pageDIV[0].innerHTML="";
				pageDIV.append(strPage);
				//赋值
				if(!map.isEmpty()){
					$("input[name='checkPlan']").each(function() {
						 var id= $(this).parent().parent().children(" td:eq(1)").html();
						 if(map.get(id)){
							 $(this).prop("checked",true);
							 var requ= $(this).parent().parent().children("td:eq(6)").find('select');
							 requ.val(map.get(id).requered);
							$(this).parent().parent().addClass("table_highlighter");
						 }
					});					
				}
				$('#groupPlanDiv').OpenDiv2()
				bindradio()
			}
		});
	}
	//打开方案组方案关联div
	function addGroupPlan(obj){
		map.clear();//清空备份map
		var editTr = $(obj).parent('td').parent('tr')[0];	
		var id=editTr.childNodes[9].innerHTML;
		var partnerNo=editTr.childNodes[4].innerHTML;
		$('#planPartner').val(partnerNo);
		$('#editId').val(id);
		queryGrouPlanList(1);
	}
	//方案组方案关联保存
	function saveGroupPlan(){
		var planNo='';
		var requered='';
		var planGroupId=$('#editId').val();
		//方案选中验证
		if(!map.isEmpty()){
			var keys=map.keys();
			//方案数量不能超过最大数
			if(keys.length>maxPlan){
				$.message("error", "方案数量不能超过"+maxPlan);
				$(this).prop("checked",false);
				return;
			}else{
				var seeMoney='';
				for(i in map.keys()){
			        var key = map.keys()[i];
			        var obj=map.get(key);
			        var see=obj.seeMoney;
			        if(see=='YD'){
			        	see='Y';
			        }
			        if(seeMoney!=see&&seeMoney!=''){
			        	$.message("error", "见费与非见费方案不能同时选择");
						$(this).prop("checked",false);
						return;
			        }else{
			        	seeMoney=obj.seeMoney;
			        	if(seeMoney=='YD'){
			        		seeMoney='Y';
			        	}
			        	planNo=planNo+","+key
			        	requered=requered+","+obj.requered;
			        }
			    }
				//插入
	        	savePlans({planNo:planNo,requered:requered,planGroupId:planGroupId})
			}
		}else{
			$.message("error", "请选择一个方案");
			return;
		}
	}
	function savePlans(param){
		$.openLoading();
		$("#BigDiv2").remove();
		$.ajax({
			url : "planGroupConfig/saveGroupPlan",
			type : 'POST',
			async : true,
			data:param,
			dataType:'json',
			success:function(result){
			    $.closeLoading();
				$.message(result.result, result.message);
				if(result.result=='success'){
					 closeCurrentDIV('groupPlanDiv');
				};
			}
		});
	}
	//删除方案组
	function delTradGroup(obj){
		var groupId= $(obj).parent().parent().children(" td:eq(9)").html();
		$.dialog({
			type: "warn",//success,error
			content: "您确定要删除该方案组吗？",
			onOk: function() {
				delGroup({groupId:groupId})
			}
		});
	}
	function delGroup(param){
		$.openLoading();
		$("#BigDiv2").remove();
		$.ajax({
			url : "planGroupConfig/delTradGroup",
			type : 'POST',
			async : true,
			data:param,
			dataType:'json',
			success:function(result){
			    $.closeLoading();
				$.message(result.result, result.message);
				if(result.result=='success'){
					queryGrouList(1);	
				};
			}
		});
	}
	
	function changeIsCoreMessage(){
		$('#messageReceiver').val("");
		var isMessage = $.trim($('#isMessage').val());
		if(isMessage =='Y'){	
			$('#messageReceiverDiv').show();		
		}else{
			$('#messageReceiverDiv').hide();
		}
	}
	function exPlan(){
		var groupId='';
		$("input[name='checkPlan1']:checked").each(function(){
			if(''==groupId){
				groupId = $(this).parent().parent().children("td:eq(9)").html()
			}else{
				groupId =groupId+","+ $(this).parent().parent().children("td:eq(9)").html()
			}
		});
		if(groupId==''){
			$.message("error", "请至少选择一个方案");
			return;
		}
		window.location.href='<%=path%>/planGroupConfig/dowloadPlan?groupId='+groupId;
	
	}
</script>	
<body>
	<div class="current">
          <table class="current_table_1">
             <tbody>
               <tr class="f2">
                 <td><img src="./images/current_1.jpg"></td>
                 <td class="current_table_1_td">
                   <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
                     <span style=" color:#136bab; ">组合产品管理
                     <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>组合方案配置
                 </span>
                 </td>
                 <td><img src="./images/current_3.jpg"></td>
             </tr>
          </tbody>
        </table>
     </div>
	
	<table class="table_02" id="table">
		<tr>
			<td>
				<table class="search_table" id="queryNlifePlanCriteriaTable">
						<tr height="25px">
						<td  height="30" style="text-align: center;">
						组合方案代码：
							&nbsp;<input name="txt3" id="groupCodeSe" value="" class="input_text" />
						组合方案名称：
							&nbsp;<input name="txt3" id="groupNameSe" value="" class="input_text" />
							<input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryGrouList(1)"/>
							<input type="button" value="重置" onClick="resetQueryNlifePlanCriteria()" class="input_button_1" />							
							<input type="button"  class="input_button_1" id="" value="新增" onClick="addGroup()"/>&nbsp;
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr style="height: 10px">
			<td>
				<table class="search_table">
					<tr height="30px">
						<td width="100%" height="30">
							 <input type="button" class="input_button_2" id="implBtn" value="导出方案" onClick="exPlan()"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table id="groupPlanTable"  class="content_table_1">
					<thead>
						<tr class="f1">
						  <th style="width:5%">导出</th>
						  <th style="width:10%">组合方案代码</th>
		                  <th style="width:10%">组合方案名称</th>
		                  <th style="width:10%">合作伙伴名称</th>
		                  <th style="width:12%">是否见费个性化流程</th>
		                  <th style="width:12%">承保短信模板</th>
		                  <th style="width:12%">邮件模板</th>
		                  <th style="width:15%">组合方案描述</th>
		                  <th style="width:10%">操作</th>
		              
		              	</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
				<div id="groupPlanPageDIV"  class="page"></div>
			</td>
		</tr>
	</table>
	<input type="hidden" value="" id='editId' />
	<input type="hidden" value="" id='editflag' />
	<input type="hidden" value="" id='planPartner' />
	<!--   	添加模板 DIV 默认隐藏-->
 	<div id="addtempletDiv"  style="display:none;width:60%">
		<input type="hidden" id="row_num" name="row_num" value="0"/>
		<div class="table_title_div">
				<table class="table_title" style='width:100%;'>
					<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="<%=path%>/images/closedown.gif" alt="关闭"  onclick="closetempletDiv()"/></td>
					</tr>
				</table>
		</div>
		<form id="inputForm" action="save.jhtml" method="post" enctype="multipart/form-data">
			
			<table class="table_02" id="addtempletTable" align="center" >
				<tbody>
					<tr>
						<td>
							<table id="productTempletTable"  class="content_table_1">
								<tbody>
									<tr>
										<td width="40%" style="text-align:right;border-right:0px;">组合方案代码：&nbsp;&nbsp;</td>
										<td width="60%" style="text-align:left"><input type="text" style="width: 250px" class="input_text" id="groupCode"><span class="red">*</span></td>
									</tr>
									<tr>
										<td width="40%" style="text-align:right;border-right:0px;">组合方案名称：&nbsp;&nbsp;</td>
										<td width="60%" style="text-align:left"><input type="text" style="width: 250px" class="input_text" id="groupName"><span class="red">*</span></td>
									</tr>
									<tr>
										<td width="40%" style="text-align:right;border-right:0px;">所属合作伙伴：&nbsp;&nbsp;</td>
										<td width="60%" style="text-align:left"><input class="input_text" style="background: #ccc;" readonly="readonly" value="" id="partnerNo" name="txt3">&nbsp;<input type="button" onclick="openChannelPageDiv(1)" value="选择" id="openChannelPageDivBtn" class="input_button_1"></td>
									</tr>
									<tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">是否返回组合电子保单下载地址：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left">
					                  	<select name="groupEURL" id="groupEURL" class="select_1" style="visibility: visible;width: 140px;">
 	                  				  		<option value="" selected>-----------请选择-----------</option>
 	                  				  		<option value="N">否</option>
 	                  				  		<option value="Y">是</option>
	                  				  	</select>
	                  				  </td>
					                </tr>
									<tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">是否见费个性化流程：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left">
					                  	<select name="seefeeSpecialFlag" id="seefeeSpecialFlag" class="select_1" style="visibility: visible;width: 140px;">
 	                  				  		<option value="" selected>-----------请选择-----------</option>
 	                  				  		<option value="N">否</option>
 	                  				  		<option value="Y">是</option>
	                  				  	</select>
	                  				  </td>
					                </tr>
					                <tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">是否发送承保短信：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left">
					                  	<select name="isMessage" id="isMessage" class="select_1" style="visibility: visible;width: 140px;" onchange="changeIsCoreMessage()" >
 	                  				  		<option value="" selected>-----------请选择-----------</option>
 	                  				  		<option value="N">否</option>
 	                  				  		<option value="Y">是</option>
	                  				  	</select>
	                  				
	                  				    <div id="messageReceiverDiv"  style="float:right;display:none;">
											接收人：
											<select name="messageReceiver"  id="messageReceiver" class="select_1" style="visibility: visible;width:90px">
												<option value="">--请选择--</option>
												<option value="0">投保人</option>
												<option value="1">被保人</option>
											</select>
									    </div>
									  </td>																  
					                </tr>
									<tr>
										<td width="40%" style="text-align:right;border-right:0px;">承保短信模板：&nbsp;&nbsp;</td>
										<td width="60%" style="text-align:left">
			                  				<textarea id="smsTemplet"  rows="5" class="textarea_1" style="resize:none;width: 300px"></textarea>
	                  				  </td>
									</tr>
									<tr>
										<td width="40%" style="text-align:right;border-right:0px;">邮件模板：&nbsp;&nbsp;</td>
										<td width="60%" style="text-align:left"><textarea id="mailTemplet"  rows="5" class="textarea_1" style="resize:none;width: 300px"></textarea></td>
									</tr>
									<tr>  
					                  <td width="40%" style="text-align:right;border-right:0px;">组合方案描述：&nbsp;&nbsp;</td>
					                  <td width="60%" style="text-align:left"><textarea style="resize:none;width: 300px" class="textarea_1" rows="5"  id="groupDesc"></textarea></td>
					                </tr>
								</tbody>
							</table>
						</td>
					</tr>
				</tbody>
			</table>
			<div align="center">
			 <input class="input_button_3" name="" type="button" onclick="saveGroup()" value="确定">&nbsp;&nbsp;
	         <input class="input_button_3" name="" type="button" onclick="closetempletDiv()" value="取消">
			</div>
		</form>
	</div>
	  	<!--选择合作伙伴 div-->
  		<div id="tradPartnerDiv" style="display:none;width:90%;text-align: center;">
		<input type="hidden" id="row_num" name="row_num" value="0"/>
			<div class="table_title_div">
					<table class="table_title" style='width:100%;height: 20px;'>
						<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('tradPartnerDiv')"/></td>
						</tr>
					</table>
			</div>
		<table class="table_02" id="table" style="width:98%">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td colspan="3" style="text-align:center">合作伙伴代码：<input name="txt3"  id="channelCode"  type="text" class="input_text" value="" >
								&nbsp;&nbsp;合作伙伴名称：<input name="txt3" id="channelName"  type="text" class="input_text" value="">
								&nbsp;&nbsp;<input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="openChannelPageDiv(1)"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="TradPartnerTable"  class="content_table_1">
						<thead>
							<tr class="f1">
			                  <th style="width:5%">选择</th>
			                  <th style="width:10%">合作伙伴代码</th>
			                  <th style="width:20%">合作伙伴名称</th>
			              	</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="TradPartnerPageDIV"  class="page"></div>
				</td>
			</tr>
		</table>
		<div align="center">
		   <input type="button" id="saveRoleBtn" value="确定" onclick="choosePartner()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
		   <input type="button" value="取消" onclick="closeCurrentDIV('tradPartnerDiv')" class="input_button_3"/>
		</div>
	</div>
	<!-- 配置方案组关联方案 -->
	<div id="groupPlanDiv" style="display:none;width:70%;">
		<div class="table_title_div">
			<table class="table_title" style="width:98%;height:20px;">
				<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('groupPlanDiv')"/></td>
				</tr>
			</table>
		</div>
		<table class="table_02" id="table" style="width:98%;" align="center">
			<tr>
				<td>
					<table class="search_table">
						<tr height="30px">
							<td colspan="3" style="text-align:center">投保方案代码：<input name="txt3"  id="planCode"  type="text" class="input_text" value="" >
									&nbsp;&nbsp;投保方案名称：<input name="txt3" id="planName"  type="text" class="input_text" value="">
									是否见费：<select style="visibility: visible;"  class="select_1 valid" id="isSeeMoney">
										  <option value=''>请选择</option>
						                  <option value="N">否</option>
						                  <option value="Y">是</option>
						               </select>&nbsp;&nbsp;
						       <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryGrouPlanList(1)"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<div style="max-height:300px;overflow-y:auto" >
						<table id="groupPlanDivTable"  class="content_table_1" >
							<thead>
								<tr class="f1">
									<th style="width:3%">选择</th>
									<th style="width:10%">投保方案代码</th>
									<th >投保方案名称</th>
									<th style="width: 5%">是否见费</th>
									<th>方案险种</th>
									<th style="width:5%">是否必须</th>
				              	</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
					<div id="groupPlanDivPage" class="page"></div>
				</td>
			</tr>
		</table>
		<div align="center">
			<input type="button" id="saveRoleBtn" value="保存" onclick="saveGroupPlan()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
			<input type="button" value="取消" onclick="closeCurrentDIV('groupPlanDiv')" class="input_button_3"/>
		</div>
	</div>
	<div id="detail" style="display:none;" >
			<div id="input" style="margin:5px;word-wrap:break-word;"></div>
		</div>
			<div id="detail2" style="display:none;">
			<h4  style='background-color:#A4BDE3;'>
				<table height="20px">
					<tr>
					    <td >
					    </td>
					    <td align="right">
					       <img src="./images/closedown.gif"  onclick="closeDiv()"/>
					    </td>
					</tr>							
				</table>
				<input type="hidden" id="appId" value="">
			</h4>	
			<div id="output" style="margin:5px;word-wrap:break-word;"></div>
		</div>
</body>
</html>